package com.qiaoba.module.system.runner;

import com.qiaoba.module.system.service.SysConfigService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

/**
 * 参数配置-项目启动后执行
 *
 * @author ailanyin
 * @date 2023-09-09 21:48:40
 */
@Component
@RequiredArgsConstructor
@Slf4j
public class SysConfigRunner implements ApplicationRunner {

    private final SysConfigService sysConfigService;

    @Override
    public void run(ApplicationArguments args) throws Exception {
        log.info("开始导入参数配置到缓存中");
        sysConfigService.resetCache();
        log.info("导入参数配置到缓存完成");
    }
}
